package com.prs.crm.domain.oa;

import java.util.Date;
import java.util.List;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

import com.prs.crm.domain.Attachment;
import com.prs.crm.domain.BaseEntity;

/**
 * OA已发图片新闻
 * @author zhoupeng 2012-3-26
 *
 */
@Entity
@Table(name="oa_picturenews")
public class PictureNews extends BaseEntity{
	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer id;
	
	private String title;  //标题
	@Lob
	private String content;  //内容
	private String receive; //接收人
	private String accepts;  //接收人id
	private String degree;  //重要程度
	private String isReceipt;  //收到后给我一个回执
	private String isComment;  //允许评论

	private Integer oabox;  //0表示草稿，1表示已发图片新闻,2表示已归档,3表示已收藏
	private String picture;//图片
	private String pictureName;
	private String pictureSize;
	
	@ManyToOne(fetch=FetchType.LAZY)
	@Cascade(CascadeType.REFRESH)
	private Attachment attach; //附属文件
	private Date creatTime;
//	
//	//已收图片新闻
//	@OneToMany(fetch=FetchType.LAZY,mappedBy="pictureNews")
//	private Set<PictureNewsReceive> recevies;
	//收藏图片新闻
	@OneToMany(fetch=FetchType.LAZY,mappedBy="pictureNews")
	private Set<PictureNewsCollect> collects;
	@OneToMany(fetch=FetchType.LAZY,mappedBy="pictureNews")
	private List<Comment> comment;
	public List<Comment> getComment() {
		return comment;
	}

	public void setComment(List<Comment> comment) {
		this.comment = comment;
	}

	private Integer top;//0不置顶   1置顶
 	public String getPictureName() {
		return pictureName;
	}

	public void setPictureName(String pictureName) {
		this.pictureName = pictureName;
	}

	public String getPictureSize() {
		return pictureSize;
	}

	public void setPictureSize(String pictureSize) {
		this.pictureSize = pictureSize;
	}

	public Integer getTop() {
		return top;
	}

	public void setTop(Integer top) {
		this.top = top;
	}

	public Date getCreatTime() {
		return creatTime;
	}

	public void setCreatTime(Date creatTime) {
		this.creatTime = creatTime;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getReceive() {
		return receive;
	}

	public void setReceive(String receive) {
		this.receive = receive;
	}

	public String getAccepts() {
		return accepts;
	}

	public void setAccepts(String accepts) {
		this.accepts = accepts;
	}

	public String getDegree() {
		return degree;
	}

	public void setDegree(String degree) {
		this.degree = degree;
	}

	public String getIsReceipt() {
		return isReceipt;
	}

	public void setIsReceipt(String isReceipt) {
		this.isReceipt = isReceipt;
	}

	public String getIsComment() {
		return isComment;
	}

	public void setIsComment(String isComment) {
		this.isComment = isComment;
	}

	public Attachment getAttach() {
		return attach;
	}

	public void setAttach(Attachment attach) {
		this.attach = attach;
	}

	public Integer getOabox() {
		return oabox;
	}

	public void setOabox(Integer oabox) {
		this.oabox = oabox;
	}

	public String getPicture() {
		return picture;
	}

	public void setPicture(String picture) {
		this.picture = picture;
	}
//
//	public Set<PictureNewsReceive> getRecevies() {
//		return recevies;
//	}
//
//	public void setRecevies(Set<PictureNewsReceive> recevies) {
//		this.recevies = recevies;
//	}

	public Set<PictureNewsCollect> getCollects() {
		return collects;
	}

	public void setCollects(Set<PictureNewsCollect> collects) {
		this.collects = collects;
	}

}
